--alter cBarcodeID from Not Null to Null
ALTER TABLE item_w ALTER COLUMN cBarcodeID FLOAT NULL
--alter DAMAGED_T add field
ALTER TABLE DAMAGED_T ADD cBarcodeID VARCHAR (25) NULL 
--alter PM_t add field
ALTER TABLE PM_T ADD cBarcodeID VARCHAR (25) NULL 
ALTER TABLE PM_T ADD cPartNo VARCHAR (25) NULL 
--alter SO_T add field
ALTER TABLE SO_T ADD cSKU VARCHAR (25) NULL 
--alter DR_T add field
ALTER TABLE DR_T ADD cSKU VARCHAR (25) NULL 
--alter SALES_T add field
ALTER TABLE SALES_T ADD cSKU VARCHAR (25) NULL 


--insert for Product Setup and AutoNumbering
DECLARE @cCompanyID VARCHAR (15)
SET @cCompanyID = '200-00'

DELETE FROM system_option WHERE cCode IN ('ITM_VAL_DUPLICATE','ITM_VIS_SUPPLIER','ITM_VIS_CUSTITEMNO',
'ITM_VAL_MEMPRICE','ITM_MAN_BARCODE','ITM_MAN_FACTOR','CLNT_MAN_COMMISSION','AUTO_NUMBER_ITMPARTNO',
'ITM_VIS_CUSTITEMNO','ITM_MAN_USEPARTNO','CLNT_MAN_USEPARENTCOMPANY','CLNT_MAN_USERDFSMAN') 
AND cCompanyID = @cCompanyID

--product/item
INSERT INTO system_option(cCompanyID,cCode,cFormName,lBit,cValue)
VALUES(@cCompanyID,'ITM_VAL_DUPLICATE', 'ITEM','1','')

INSERT INTO system_option(cCompanyID,cCode,cFormName,lBit,cValue)
VALUES(@cCompanyID,'ITM_VIS_SUPPLIER', 'ITEM','1','')

INSERT INTO system_option(cCompanyID,cCode,cFormName,lBit,cValue)
VALUES(@cCompanyID,'ITM_VIS_CUSTITEMNO', 'ITEM','1','')

INSERT INTO system_option(cCompanyID,cCode,cFormName,lBit,cValue)
VALUES(@cCompanyID,'ITM_VAL_MEMPRICE', 'ITEM','1','')

INSERT INTO system_option(cCompanyID,cCode,cFormName,lBit,cValue)
VALUES(@cCompanyID,'ITM_MAN_BARCODE', 'ITEM','1','')

INSERT INTO system_option(cCompanyID,cCode,cFormName,lBit,cValue)
VALUES(@cCompanyID,'ITM_MAN_FACTOR', 'ITEM','1','')

INSERT INTO system_option(cCompanyID,cCode,cFormName,lBit,cValue)
VALUES(@cCompanyID,'ITM_MAN_USEPARTNO', 'ITEM','1','')

INSERT INTO system_option(cCompanyID,cCode,cFormName,lBit,cValue)
VALUES(@cCompanyID,'ITM_MAN_USECUSTITEMNO', 'ITEM','1','')

INSERT INTO system_option(cCompanyID,cCode,cFormName,lBit,cValue)
VALUES(@cCompanyID,'ITM_VIS_CUSTITEMNO', 'ITEM','1','')

--autonumbering
INSERT INTO system_option(cCompanyID,cCode,cFormName,lBit,cValue)
VALUES(@cCompanyID,'AUTO_NUMBER_ITMPARTNO', '0','1','1995001090')


INSERT INTO system_option(cCompanyID,cCode,cFormName,lBit,cValue)
VALUES(@cCompanyID,'CLNT_MAN_COMMISSION', 'CLIENT','1','')

INSERT INTO system_option(cCompanyID,cCode,cFormName,lBit,cValue)
VALUES(@cCompanyID,'CLNT_MAN_USEPARENTCOMPANY', 'CLIENT','1','')

INSERT INTO system_option(cCompanyID,cCode,cFormName,lBit,cValue)
VALUES(@cCompanyID,'CLNT_MAN_USERDFSMAN', 'CLIENT','1','')

INSERT INTO system_option(cCompanyID,cCode,cFormName,lBit,cValue)
VALUES(@cCompanyID,'ITM_VER_ALLSPLYREQ', 'ITEM','1','SUPERUSER')

--SELECT * FROM system_option so

--UPDATE system_option 
--SET cValue = '1995001090'
--WHERE cCode = 'AUTO_NUMBER_ITMPARTNO'